import java.util.Arrays;

public class Test {
    //二维数组
    //二维数组是特殊的一维数组
    //栈上放的是局部变量
    public static void main(String[] args) {
        //行不可以省略，列可以省略
        int[][] array = new int[2][];
        /*System.out.println(array3[0]);//null
        System.out.println(array3[1]);//null*/

        //不规则二维数组
        /*array[0] = new int[2];
        array[1] = new int[4];*/
        array[0] = new int[]{11, 22, 33, 44};
        array[1] = new int[]{111, 221, 331, 441, 999, 888, 777};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j] + " ");
            }
            System.out.println();
        }

    }

    public static void main6(String[] args) {
        int[][] array = {{1, 2, 3}, {4, 5, 6}};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j] + " ");
            }
            System.out.println();
        }
        System.out.println("=============");
        for (int[] ret : array) {
            for (int x : ret) {
                System.out.print(x + " ");
            }
            System.out.println();
        }
        System.out.println("=============");
        System.out.println(Arrays.deepToString(array));
        /*System.out.println(Arrays.toString(array[0]));
        System.out.println(Arrays.toString(array[1]));*/
    }
    public static void main5(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
        System.out.println("=============");
        int[][] array2 = new int[][]{{1,2,3},{4,5,6}};

    }
}
